﻿<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>我的桌面</title>
    <!--框架必需start-->
    @*<link href="~/Content/styles/learun-ui.css" rel="stylesheet" />*@
    <script src="~/Content/Scripts/jquery/jquery-1.10.2.min.js"></script>
    <link href="~/Content/styles/font-awesome.min.css" rel="stylesheet" />
    @*<script src="~/Content/Scripts/utils/LeSoft-ui.js"></script>*@
    @System.Web.Optimization.Styles.Render("~/Content/styles/LeSoft-ui.css")
    @System.Web.Optimization.Scripts.Render("~/Content/scripts/utils/js")

    <link href="~/Content/scripts/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/styles/font-awesome.min.css" rel="stylesheet" />
    <link href="~/Content/scripts/plugins/footable/footable.core.css" rel="stylesheet" />
    <link href="~/Content/styles/anitmate.css" rel="stylesheet" />
    <link href="~/Content/styles/style.css?v=4.1.0" rel="stylesheet" />

</head>

<body>

    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-sm-12">
                <div class="row">
                    <div class="col-sm-4">
                        <div class='row row-sm text-center' id="characterlist">
                            <div class='col-xs-6'>
                                <div class='panel padder-v item ' style='background-color: #27c24c;'>
                                    <div class='h1 text-fff font-thin h1'>?</div>
                                    <h3>暂无指标数据</h3>
                                </div>
                            </div>
                            <div class='col-xs-6'>
                                <div class='panel padder-v item' style='background-color: #27c24c;'>
                                    <div class='h1 text-fff font-thin h1'>?</div>
                                    <h3>暂无指标数据</h3>
                                </div>
                            </div>
                            <div class='col-xs-6'>
                                <div class='panel padder-v item yellow-bg'>
                                    <div class='h1 text-fff font-thin h1'>?</div>
                                    <h3>暂无指标数据</h3>
                                </div>
                            </div>
                            <div class='col-xs-6'>
                                <div class='panel padder-v item red-bg'>
                                    <div class='h1 text-fff font-thin h1'>?</div>
                                    <h3>暂无指标数据</h3>
                                </div>
                            </div>
                        </div>

                    </div>
                    <div class="col-sm-8">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title" style="border-bottom:none;background:#fff;">
                                <h5>工单统计</h5>
                            </div>
                            <div class="ibox-content" style="border-top:none;">
                                <div class="echarts" id="echarts-bar-chart"></div>

                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-sm-5">
                        <div class="ibox float-e-margins">
                            <div id="ibox-content">
                                <div id="vertical-timeline" class="vertical-container light-timeline">
                                    @*<div class="vertical-timeline-block">
                                            <div class="vertical-timeline-icon navy-bg">
                                                <i class="fa fa-briefcase"></i>
                                            </div>
                                            <div class="vertical-timeline-content">
                                                <h2>会议</h2>
                                                <p>
                                                    上一年的销售业绩发布会。总结产品营销和销售趋势及销售的现状。
                                                </p>
                                                <a href="#" class="btn btn-sm btn-primary"> 更多信息</a>
                                                <span class="vertical-date">
                                                    今天 <br>
                                                    <small>2月3日</small>
                                                </span>
                                            </div>
                                        </div>
                                        <div class="vertical-timeline-block">
                                            <div class="vertical-timeline-icon navy-bg">
                                                <i class="fa fa-briefcase"></i>
                                            </div>
                                            <div class="vertical-timeline-content">
                                                <h2>放假通知</h2>
                                                <p>
                                                    公司定于4月1日至3日，为清明节假期，希望大家做好节假日工作安排。
                                                </p>
                                                <a href="#" class="btn btn-sm btn-primary"> 更多信息</a>
                                                <span class="vertical-date">
                                                    今天 <br>
                                                    <small>@System.DateTime.Now</small>
                                                </span>
                                            </div>
                                        </div>
                                        <div class="vertical-timeline-block">
                                            <div class="vertical-timeline-icon blue-bg">
                                                <i class="fa fa-file-text"></i>
                                            </div>

                                            <div class="vertical-timeline-content">
                                                <h2>给张三发送文档</h2>
                                                <p>发送上年度《销售业绩报告》</p>
                                                <a href="#" class="btn btn-sm btn-success"> 下载文档 </a>
                                                <span class="vertical-date">
                                                    今天 <br>
                                                    <small>2月3日</small>
                                                </span>
                                            </div>
                                        </div>
                                        <div class="vertical-timeline-block">
                                            <div class="vertical-timeline-icon lazur-bg">
                                                <i class="fa fa-user-md"></i>
                                            </div>

                                            <div class="vertical-timeline-content">
                                                <h2>公司年会</h2>
                                                <p>发年终奖啦，啦啦啦~~</p>
                                                <span class="vertical-date">前天 <br><small>2月1日</small></span>
                                            </div>
                                        </div>*@

                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-7">
                        <div class="ibox">
                            <div class="ibox-title">
                                <h5>待办任务</h5>
                                <div class="ibox-tools">
                                    <a id="testbtn" onclick="TestConfirm()" class="btn btn-primary btn-xs">创建新项目</a>
                                    <a id="loading-example-btn" onclick="SetProjectList()" class="btn btn-white btn-sm" style="margin-top: -9px; color: black;"><i class="fa fa-refresh"></i>  刷新</a>
                                </div>
                            </div>
                            <div class="ibox-content">
                                @*<div class="row m-b-sm m-t-sm">
                                        <div class="col-md-1">
                                            <button type="button" id="loading-example-btn" class="btn btn-white btn-sm"><i class="fa fa-refresh"></i>刷新</button>
                                        </div>
                                        <div class="col-md-11">
                                            <div class="input-group">
                                                <input type="text" placeholder="请输入项目名称" class="input-sm form-control" />
                                                <span class="input-group-btn">
                                                    <button type="button" class="btn btn-sm btn-primary"> 搜索</button>
                                                </span>
                                            </div>
                                        </div>
                                    </div>*@
                                <div class="project-list">
                                    @*<table class="footable table table-hover" data-page-size="5">
                                            <tbody>
                                                <tr>
                                                    <td class="project-status"><span class="label label-primary" style="font-size: 13px;">维修派工</span></td>
                                                    <td class="project-title"><a>单据编号：WX20170200001 <br>地点：永新国际广场/A座/第01层/101<br>内容：sada</a><br><small>创建于 2014.08.15</small></td>
                                                    <td class="project-actions"><button class="btn btn-white btn-sm"><i class="fa fa-folder"></i> 查看 </button> </td>
                                                </tr>
                                                <tr>
                                                    <td class="project-status"><span class="label label-warning" style="font-size: 13px;">装修巡检</span></td>
                                                    <td class="project-title"><a>单据编号：ZX20170200001 <br>地点：永新国际广场/A座/第01层/203<br>巡检项目：管理巡检</a><br><small>创建于 2014.08.15</small></td>
                                                    <td class="project-actions"><button class="btn btn-white btn-sm"><i class="fa fa-folder"></i> 查看 </button> </td>
                                                </tr>
                                                <tr>
                                                    <td class="project-status"><span class="label label-danger" style="font-size: 13px;">投诉处理</span></td>
                                                    <td class="project-title"><a>单据编号：TS20170200001 <br>地点：永新国际广场/A座/第01层/101<br>投诉内容：sada</a><br><small>创建于 2014.08.15</small></td>
                                                    <td class="project-actions"><button class="btn btn-white btn-sm"><i class="fa fa-folder"></i> 查看 </button> </td>
                                                </tr>
                                                <tr>
                                                    <td class="project-status"><span class="label label-primary" style="font-size: 13px;">维修派工</span></td>
                                                    <td class="project-title"><a>单据编号：WX20130415003 <br>地点：永新国际广场/A座/第01层/101<br>内容：sada</a><br><small>创建于 2013.04.15</small></td>
                                                    <td class="project-actions"><button class="btn btn-white btn-sm"><i class="fa fa-folder"></i> 查看 </button></td>
                                                </tr>
                                                <tr>
                                                    <td class="project-status"><span class="label label-danger" style="font-size: 13px;">投诉处理</span></td>
                                                    <td class="project-title"><a>单据编号：TS20140215001 <br>地点：永新国际广场/A座/第01层/301<br>投诉内容：sada</a><br><small>创建于 2014.02.15</small></td>
                                                    <td class="project-actions"><button class="btn btn-white btn-sm"><i class="fa fa-folder"></i> 查看 </button></td>
                                                </tr>
                                                <tr>
                                                    <td class="project-status"><span class="label label-danger" style="font-size: 13px;">投诉处理</span></td>
                                                    <td class="project-title"><a>单据编号：TS20170200001 <br>地点：永新国际广场/A座/第01层/101<br>投诉内容：sada</a><br><small>创建于 2014.08.15</small></td>
                                                    <td class="project-actions"><button class="btn btn-white btn-sm"><i class="fa fa-folder"></i> 查看 </button> </td>
                                                </tr>
                                                <tr>
                                                    <td class="project-status"><span class="label label-primary" style="font-size: 13px;">维修派工</span></td>
                                                    <td class="project-title"><a>单据编号：WX20130415003 <br>地点：永新国际广场/A座/第01层/101<br>内容：sada</a><br><small>创建于 2013.04.15</small></td>
                                                    <td class="project-actions"><button class="btn btn-white btn-sm"><i class="fa fa-folder"></i> 查看 </button> </td>
                                                </tr>
                                                <tr>
                                                    <td class="project-status"><span class="label label-danger" style="font-size: 13px;">投诉处理</span></td>
                                                    <td class="project-title"><a>单据编号：TS20140215001 <br>地点：永新国际广场/A座/第01层/301<br>投诉内容：sada</a><br><small>创建于 2014.02.15</small></td>
                                                    <td class="project-actions"><button class="btn btn-white btn-sm"><i class="fa fa-folder"></i> 查看 </button></td>
                                                </tr>
                                            </tbody>
                                            <tfoot><tr><td colspan="3"><ul class='pagination pull-right'></ul></td></tr></tfoot>
                                        </table>*@
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            @*<div class="col-sm-2">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>业务预警</h5>
                        </div>
                        <div class="ibox-content">
                            <ul class="todo-list m-t small-list ui-sortable" id="tasklist">
                                <li><a class="check-link"><i class="fa fa-bell" style="color: rgb(248, 172, 89)"></i> </a><span class="m-l-xs">欠费</span><br />
                                    <small class="label label-primary"><i class="fa fa-clock-o"></i>欠费18户<br />欠费45,5487元</small>
                                </li>
                                <li>
                                    <a class="check-link"><i class="fa fa-bell" style="color: rgb(248, 172, 89)"></i> </a><span class="m-l-xs">空置房间</span><br />
                                    <small class="label label-primary"><i class="fa fa-clock-o"></i>空置房间数20套<br />空置面积5,487.24平米</small>
                                </li>
                                <li>
                                    <a class="check-link"><i class="fa fa-bell" style="color: rgb(248, 172, 89)"></i> </a><span class="m-l-xs">到期未退租合同</span><br />
                                    <small class="label label-primary"><i class="fa fa-clock-o"></i>到期未处理合同数为6份</small>
                                </li>
                                <li>
                                    <a class="check-link"><i class="fa fa-bell" style="color: rgb(248, 172, 89)"></i> </a><span class="m-l-xs">到期证照</span><br />
                                    <small class="label label-primary"><i class="fa fa-clock-o"></i>已到期的租户证照5张</small>
                                </li>
                                <li>
                                    <a class="check-link"><i class="fa fa-bell" style="color: rgb(248, 172, 89)"></i> </a><span class="m-l-xs">到期车辆</span><br />
                                    <small class="label label-primary"><i class="fa fa-clock-o"></i>已到期月租车辆共4辆</small>
                                </li>
                                <li>
                                    <a class="check-link"><i class="fa fa-bell" style="color: rgb(248, 172, 89)"></i> </a><span class="m-l-xs">逾期未完成巡检</span><br />
                                    <small class="label label-primary"><i class="fa fa-clock-o"></i>逾期未完成巡检工单数量18份</small>
                                </li>
                                <li>
                                    <a class="check-link"><i class="fa fa-bell" style="color: rgb(248, 172, 89)"></i> </a><span class="m-l-xs">逾期未完成审批流程</span><br />
                                    <small class="label label-primary"><i class="fa fa-clock-o"></i>逾期未完成审批流任务5个</small>
                                </li>
                                <li>
                                    <a class="check-link"><i class="fa fa-bell" style="color: rgb(248, 172, 89)"></i> </a><span class="m-l-xs">逾期未完成装修</span><br />
                                    <small class="label label-primary"><i class="fa fa-clock-o"></i>逾期未完成装修户数8户</small>
                                </li>

                            </ul>
                        </div>
                    </div>
                </div>*@
        </div>
    </div>


    <!-- 全局js -->
    <script src="~/Content/scripts/bootstrap/bootstrap.min.js"></script>
    <script src="~/Content/scripts/plugins/layer/layer.min.js"></script>
    <script src="~/Content/scripts/plugins/echarts/echarts.min.js"></script>
    <!-- Flot -->
    <script src="~/Content/scripts/plugins/flot/jquery.flot.js"></script>
    <script src="~/Content/scripts/plugins/flot/jquery.flot.tooltip.min.js"></script>
    <script src="~/Content/scripts/plugins/flot/jquery.flot.resize.js"></script>
    <script src="~/Content/scripts/plugins/flot/jquery.flot.pie.js"></script>
    <!-- 自定义js -->
    <script src="~/Content/scripts/plugins/footable/footable.all.min.js"></script>
    <script src="~/Content/scripts/utils/content.js"></script>

    <script type="text/javascript">
        var datax = [], datay = [];
        $(function () {
            $.ajax({
                url: "/Home/GetCountBill",
                type: "get",
                dataType: "json",
                success: function (data) {
                    datax = data.datax;
                    datay = data.datay;
                    Echart();
                },
                error: function (e) {
                    alert(Error);
                }
            });
          
            SetCharacterList();
            SetProjectList();
            SetNoticeList();
            //SetTaskList();

        });

        //任务列表
        function SetProjectList() {
            var otable = $('.project-list');
            $.ajax({
                url: "/Home/GetTaskList",
                type: "get",
                dataType: "json",
                success: function (data) {
                    if (data.count < 5) {
                        otable.height('633px');
                    }
                    if (data.count > 0) {
                        otable.html("");
                        otable.html(data.html);
                        $('.footable').footable();
                    }
                    else {
                        otable.html("<span class='label label-danber' style='margin: 30px;'>目前暂无数据</span>");
                    }
                },
                error: function (e) {
                    alert(Error);
                }
            });
        }
        //任务详情
        function btn_TaskDetail(keyValue, type) {
            if (type == 1) {
                dialogOpen({
                    id: "Form",
                    title: '详情',
                    url: '/Utility/Details?keyValue=' + keyValue + "&Type=1",
                    width: "1000px",
                    height: "600px",
                    btn: ['关闭'],
                    callBack: function (iframeId) {
                        top.frames[iframeId].AcceptClick();
                    }
                });
            }
            else {
                //
                $.ajax({
                    url: "/Home/GetFlowInfo?keyValue=" + keyValue,
                    type: "get",
                    dataType: "json",
                    success: function (data) {
                        debugger;
                        dialogOpen({
                            id: "ProcessLookForm",
                            title: '审核流程',
                            url: encodeURI(encodeURI('/FlowManage/FlowToDo/VerificationFrom?processSchemeId=' + data.ProcessSchemeId + '&activityId=' + data.ActivityId + '&processInstanceId=' + data.Id + '&createusername=' + data.CreateUserName + '&description=' + data.Description)),
                            width: "1100px",
                            height: "700px",
                            btn: null,
                            callBack: function (iframeId) {

                            }
                        });
                    },
                    error: function (e) {
                        alert(Error);
                    }
                });
               
            }   
        }

        //新闻公告
        function SetNoticeList() {
            var otable = $('#vertical-timeline');
            $.ajax({
                url: "/Home/GetNotice",
                type: "get",
                dataType: "json",
                success: function (data) {
                    if (data.count < 4) {
                        otable.height('633px');
                    }
                    if (data.count > 0) {
                        otable.html("");
                        otable.html(data.html);
                    }
                    else {
                        otable.html("<span class='label label-danger'style='margin: 30px;'>目前暂未发布公告通知</span>");
                    }
                },
                error: function (e) {
                    alert(Error);
                }
            });
        }
        //新闻公告详情
        function btn_NoticeDetail(keyValue) {
            dialogOpen({
                id: "Form",
                title: '详情',
                url: '/Utility/Details?keyValue=' + keyValue + "&Type=2",
                width: "1000px",
                height: "600px",
                btn: ['关闭'],
                callBack: function (iframeId) {
                    top.frames[iframeId].AcceptClick();
                }
            });
        }


        //指标列表
        function SetCharacterList() {
            var odiv = $('#characterlist');
            $.ajax({
                url: "/Home/GetCharacter",
                type: "get",
                dataType: "json",
                success: function (data) {
                    if (data.count < 4) {
                        odiv.height('360px');
                    }
                    if (data.count > 0) {
                        odiv.html("");
                        odiv.html(data.html);
                    }
                },
                error: function (e) {
                    alert(Error);
                }
            });
        }

        //业务预警
        function SetTaskList() {
            var oul = $("#tasklist");
            $.ajax({
                url: "/Home/GetTaskList",
                type: "get",
                dataType: "json",
                success: function (data) {
                    oul.html("");
                    debugger;
                    if (data.count > 0) {
                        oul.html(data.html);
                    }
                    else {
                        oul.html("<li><a></a><span style='color:red;'>目前暂无数据</span></li>");
                    }
                },
                error: function (e) {
                    alert(Error);
                }
            });

        }

        function Echart() {
            var barChart = echarts.init(document.getElementById("echarts-bar-chart"));
            var baroption = {
                tooltip: { trigger: 'item' },
                toolbox: {
                    show: true,
                    orient: 'vertical',
                    y: 'center',
                    feature: { mark: { show: true }, dataView: { show: true, readOnly: false }, magicType: { show: true, type: ['line', 'bar'] }, restore: { show: true }, saveAsImage: { show: true } }
                },
                calculable: true,
                grid: { borderWidth: 0, y: 80, y2: 60 },
                xAxis: [{ type: 'category', show: false, data: datax }],
                yAxis: [{ type: 'value', show: false }],
                series: [
                    {
                        name: '工单池内单据数量',
                        type: 'bar',
                        itemStyle: {
                            normal: {
                                color: function (params) {
                                    var colorList = [
                                       '#FCCE10', '#0099FF', '#99CC33', '#CC33FF', '#0099FF',
                                       '#FE8463', '#9BCA63', '#FAD860', '#F3A43B', '#60C0DD',
                                       '#D7504B', '#C6E579', '#F4E001', '#F0805A', '#26C0C0'
                                    ];
                                    return colorList[params.dataIndex]
                                },
                                label: {
                                    show: true,
                                    position: 'top',
                                    formatter: '{b}\n{c}'
                                }
                            }
                        },
                        data: datay
                    }
                ]
            };
            barChart.setOption(baroption);
            window.onresize = barChart.resize;
        }


        function TestConfirm() {
            $.ConfirmAjax({
                msg: "请确认是否要【提交审核】流程？",
                //url: "../../FlowManage/FlowProcess/VerificationProcess",
               // param: { processId: 1 },
                success: function (data) {
                    debugger;
                    $.currentIframe().callBack();
                    dialogClose();
                }
            })

        }


    </script>
</body>
</html>
